C/S 7687
Signed-off-by: Haifeng Xue <haifeng.xue@intel.com>
Signed-off-by: Xin Li <xin.b.li@intel.com>
return 0;
error_out:
- free(mmu);
- free(page_array);
+ if ( mmu != NULL )
+ free(mmu);
+ if ( page_array != NULL )
+ free(page_array);
return -1;
}
if ( mlock(&st_ctxt, sizeof(st_ctxt) ) )
{
- PERROR("xc_vmx_build: ctxt mlock failed");
+ PERROR("%s: ctxt mlock failed", __func__);
return 1;
}
goto error_out;
}
- free(image);
+ if ( image != NULL )
+ free(image);
ctxt->flags = VGCF_VMX_GUEST;
/* FPU is set up to default initial state. */
return rc;
error_out:
- free(image);
+ if ( image != NULL )
+ free(image);
return -1;
}